package com.xqb.modules.service.impl;

import java.util.List;
import com.xqb.common.utils.DateUtils;
import com.xqb.modules.domain.po.MktExchangeCode;
import com.xqb.modules.service.IMktExchangeCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xqb.modules.mapper.MktExchangeCodeMapper;

/**
 * 兑换码Service业务层处理
 * 
 * @author xqb
 * @date 2024-10-15
 */
@Service
public class MktExchangeCodeServiceImpl implements IMktExchangeCodeService
{
    @Autowired
    private MktExchangeCodeMapper mktExchangeCodeMapper;

    /**
     * 查询兑换码
     * 
     * @param id 兑换码主键
     * @return 兑换码
     */
    @Override
    public MktExchangeCode selectMktExchangeCodeById(Long id)
    {
        return mktExchangeCodeMapper.selectMktExchangeCodeById(id);
    }

    /**
     * 查询兑换码列表
     * 
     * @param mktExchangeCode 兑换码
     * @return 兑换码
     */
    @Override
    public List<MktExchangeCode> selectMktExchangeCodeList(MktExchangeCode mktExchangeCode)
    {
        return mktExchangeCodeMapper.selectMktExchangeCodeList(mktExchangeCode);
    }

    /**
     * 新增兑换码
     * 
     * @param mktExchangeCode 兑换码
     * @return 结果
     */
    @Override
    public int insertMktExchangeCode(MktExchangeCode mktExchangeCode)
    {
        mktExchangeCode.setCreateTime(DateUtils.getNowDate());
        return mktExchangeCodeMapper.insertMktExchangeCode(mktExchangeCode);
    }

    /**
     * 修改兑换码
     * 
     * @param mktExchangeCode 兑换码
     * @return 结果
     */
    @Override
    public int updateMktExchangeCode(MktExchangeCode mktExchangeCode)
    {
        mktExchangeCode.setUpdateTime(DateUtils.getNowDate());
        return mktExchangeCodeMapper.updateMktExchangeCode(mktExchangeCode);
    }

    /**
     * 批量删除兑换码
     * 
     * @param ids 需要删除的兑换码主键
     * @return 结果
     */
    @Override
    public int deleteMktExchangeCodeByIds(Long[] ids)
    {
        return mktExchangeCodeMapper.deleteMktExchangeCodeByIds(ids);
    }

    /**
     * 删除兑换码信息
     * 
     * @param id 兑换码主键
     * @return 结果
     */
    @Override
    public int deleteMktExchangeCodeById(Long id)
    {
        return mktExchangeCodeMapper.deleteMktExchangeCodeById(id);
    }
}
